Repository navigation
feat(zed): rename the extension id and reap superseded binaries - #203
Merged
Merged
Conversation
The Zed registry requires an extension id that conveys what the extension does; the bare `codegraph` only qualifies under the exception for widely known tooling, which does not apply. Rename to `mcp-server-codegraph`: the registry carries 44 `mcp-server-*` entries and no `*-mcp-server` ones, and an id cannot be changed after publication. The `[context_servers.codegraph]` key stays. It is not required to match the extension id — the published `chrome-devtools-mcp` declares a different one — and `codegraph install` plus every hand-written Zed config already reference `context_servers.codegraph`. Reap superseded `codegraph-*` version dirs after a successful download so the extension work directory stops growing with every release. The reap is gated on the download path, so a cache hit never runs it; it is prefix-scoped, so unrelated state survives; and removal is best-effort, so a directory that cannot be deleted never fails a launch.
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## main #203 +/- ##
==========================================
+ Coverage 95.16% 95.17% +0.01%
==========================================
Files 136 136
Lines 72320 72936 +616
==========================================
+ Hits 68822 69420 +598
- Misses 3498 3516 +18 see 5 files with indirect coverage changes 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Addresses the review on zed-industries/extensions#6732.
Extension id →
mcp-server-codegraphThe Zed publishing prerequisites require an id that conveys what the extension does, with an exception only for "languages or popular tooling that people would expect to find under that ID". A bare
codegraphdoes not qualify, so the id changes.Prefix form, not suffix, measured against the live registry: 44
mcp-server-*entries, 0*-mcp-serverentries. The maintainer's own precedent (#4861) landed asmcp-server-zuraffa. An id cannot be changed after publication, so this follows the 44 precedents.namebecomesCodeGraph MCP Server; Zed searchesnametoo, so typing "codegraph" still finds it.[context_servers.codegraph]is deliberately unchangedThe context-server key is not required to equal the extension id — the published
chrome-devtools-mcpdeclares[context_servers.chrome-devtools-mcp-zed]underid = "chrome-devtools-mcp". Renaming ours would break everycontext_servers.codegraphentry thatcodegraph install/codegraph init --target=zedhas already written, plus every hand-written config, for no gain.Auto-cleanup of superseded binaries
Each launch resolves the latest release and caches it under
codegraph-<version>/, so the work directory previously kept every version it had ever downloaded. It now reaps supersededcodegraph-*dirs, with three deliberate properties:.ok()) — a dir that cannot be deleted, such as an in-use.exeon Windows, must never fail a server launch.This matches
zed-industries/zed's ownprotoandtest-extensionhelpers.Verification
wasm32-wasip2(target installed rather than substitutingcargo check);clippy -D warningsclean, both run insideeditors/zed/.crates/, the rootCargo.toml/Cargo.lock,reference/, and CI;make cigreen at 127 suites / 3146 passed / 0 failed.Two pre-existing doc errors in the paragraph this touched are corrected: the cache path is
extensions/work/<id>/, notextensions/installed/<id>/, and the Windows data root is%LOCALAPPDATA%\Zed, not%APPDATA%\Zed.